<template>
  <div class="wrap">
    <div class="root" flex="cross:center dir:top">
      <div class="succ-tips"><img src="../assets/succ.png"><span>欢迎购买</span></div>
      <div class="card">
        <div class="ts-logo"></div>

        <div class="s">
          <div class="point-left"></div>
          <div class="point-right"></div>
        </div>

        <div class="qrcode-container" flex="cross:center main:center dir:top">
          <div class="qrcode"></div>
          <span class="qrcode-ticket">验证码:{{id||'发生错误id不存在!'}}</span>
        </div>
      </div>
      <p class="tips">
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp您已成功购买TATTOO绣门票，以上是您的门票二维码。展会当天凭二维码到【网络售票签到处】换取入场凭证，请妥善保管收到的短信和二维码。客服微信：<span
        style="text-decoration:underline">wenshendakaqicai</span>
      </p>
      <div class="logo"></div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'hello',
    data () {
      return {
        id: ''
      }
    },
    mounted(){
      jQuery('.qrcode').qrcode({width: 150, height: 150, correctLevel: 0, text: location.href});
      let res = location.pathname.match(/\/p\/(.*)/);
      if (res)
        this.id = res[1];
      else
        this.id = null;
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .wrap {
    width: 100%;
    height: 100%;
    background-color: #e62229;
    overflow: scroll;
  }

  .root {
    width: 100%;
    color: #fff;
    position: relative;
  }

  .succ-tips {
    margin: 21px;
    font-size: 20px;
  }

  .succ-tips img {
    height: 37px;
    width: 37px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 15px;
  }

  .ts-logo {
    background-image: url("../assets/ic_ts_logo.png");
    height: 65px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 22px;
  }

  .s {
    border-bottom: 1px dashed #ddd;
  }

  .card {
    background-color: #fff;
    border-radius: 8px;
    width: 300px;
  }

  .point-right {
    border-radius: 8px;
    height: 16px;
    width: 16px;
    background-color: #e62229;
    position: absolute;
    margin-left: 292px;
    margin-top: -8px;
  }

  .point-left {
    border-radius: 8px;
    height: 16px;
    width: 16px;
    background-color: #e62229;
    position: absolute;
    margin-left: -8px;
    margin-top: -8px;
  }

  .qrcode-container {
    height: 208px;

  }

  .qrcode-ticket {
    color: #111;
    font-size: 12px;
    margin-top: 5px;
  }

  .tips {
    margin-top: 23px;
    width: 300px;
    font-size: 14px;
  }

  .logo {
    background-image: url("../assets/logo.png");
    width: 100px;
    height: 30px;
    margin: 23px;
    background-size: contain;
    background-repeat: no-repeat;
  }
</style>
